import VueRouter from "vue-router";

//登录
import login from "../login/LoginName"
import frame from "../frame/FrameName"
// 首页
import home from "../home/HomeName"

//用户管理
import user from "../users/UsersName"
import users from "../users/UsersName1"

//权限管理
import power from "../power/PowerName"
import roles from "../power/PowerName1"
import rights from "../power/PowerName2"

// 商品管理
import goods from "../goods/GoodsName"
import goodss from "../goods/GoodsName1"
import params from "../goods/GoodsName2"
import categories from "../goods/GoodsName3"
import addgood from "../goods/AddGoodName"

// 订单管理
import order from "../order/OrderName"
import orders from "../order/OrderName1"

// 数据统计
import data from "../data/DataName"
import datas from "../data/DataName1"

let a= new VueRouter({
    routes:[
        {
            path:"/",
            redirect: '/login'
        },
        {
            path:"/login",
            component:login,
        },
        {
            path:"/frame",
            component:frame,
            meta:{isAuth:true},
            redirect:{name:"homes"},
            children:[
                {
                    path:"home",
                    name:"homes",
                    component:home
                }, 
                //用户管理
                {
                    path:"user",
                    component:user,
                    redirect:{name:"users"},
                    children:[
                        {
                            path:"users",
                            name:"users",
                            component:users
                        }
                    ]
                }, 
                //权限管理
                {
                    path:"power",
                    component:power,
                    redirect:{name:"roles"},
                    children:[
                        {
                            path:"roles",
                            name:"roles",
                            component:roles
                        },
                        {
                            path:"rights",
                            name:"rights",
                            component:rights
                        }
                    ]
                }, 
                // 商品管理
                {
                    path:"goods",
                    component:goods,
                    redirect:{name:"goodss"},
                    children:[
                        {
                            path:"goodss",
                            name:"goodss",
                            component:goodss
                        },
                        {
                            path:"addgood",
                            name:"addgood",
                            component:addgood
                        },
                        {
                            path:"params",
                            name:"params",
                            component:params
                        },
                        {
                            path:"categories",
                            name:"categories",
                            component:categories
                        }
                    ]
                }, 
                // 订单管理
                {
                    path:"order",
                    component:order,
                    redirect:{name:"orders"},
                    children:[
                        {
                            path:"orders",
                            name:"orders",
                            component:orders
                        }
                    ]
                }, 
                // 数据统计
                {
                    path:"data",
                    component:data,
                    redirect:{name:"datas"},
                    children:[
                        {
                            path:"datas",
                            name:"datas",
                            component:datas
                        }
                    ]
                }
            ]
        },
        
    ]
})

export default a;

